﻿using MinimalistFoodStreet.BackEnd.Infrastructure.Dtos.Request.Tables;
using MinimalistFoodStreet.BackEnd.Infrastructure.EFCore;

namespace MinimalistFoodStreet.BackEnd.Server.Server.RequestExtend.Tables
{
    public static class RequestUpdatePromotionsDtoExtend
    {
        public static Promotion ToCreateEntity(this RequestUpdatePromotionsDto dto)
        {
            return new Promotion
            {
                PGoodId = dto.id,
                PDiscountPrice = dto.discountPrice,
                PStartTime = dto.startTime,
                PEndTime = dto.endTime,
            };
        }
    }
}
